<?php

class liveFeedModule extends abstractModule
{
	public function indexAction()
	{
		return $this->twig->render('/livefeed/index.twig',array());
	}

	public function ajaxAction()
	{
		$sql = "SELECT * FROM skater_lines 
		ORDER BY `skater_lines`.`timestamp` DESC";
		$res = mysql_query($sql);
		$skaters=array();
		while($skater = mysql_fetch_assoc($res))
			if(!isset($skaters[$skater['skater_ID']]))
			$skaters[$skater['skater_ID']] = $skater;
		
		return $this->twig->render('/livefeed/ajax.twig', array('skaters' => $skaters));
	}
}
?>